package com.learn.error;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class MyExceptionHandler {

	@ResponseBody
	@ExceptionHandler(value=Exception.class)
	public String errorHandler(Exception e){
		return "error!!  "+ e.getClass().getName()+"   ==   " +e.getMessage();
	}
}
